package example2;

/**
 * <h3>designPattern</h3>
 * <p>支付策略上下文</p>
 * @author : zhang.bw
 * @date : 2020-06-05 14:48
 **/
public class PayContext {

	//默认支付阿里支付
	private Payment strategy = new AliPayment();

	//允许修改策略
	public void setStrategy(Payment strategy){
		this.strategy = strategy;
	}

	// 调用各自支付策略业务
	public PayResult payment(String uid, int amout) {
		return this.strategy.pay(uid,amout);
	}
}
